package com.DHH.Service.Capital.Impl;
import com.DHH.Entity.Capital.CapitalSecurityGivebackState;
import com.DHH.Mapper.Capital.CapitalSecurityGivebackStateMapper;
import com.DHH.Service.Capital.ICapitalSecurityGivebackStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CapitalSecurityGivebackStateServiceImpl implements ICapitalSecurityGivebackStateService{
	
	@Autowired
    private CapitalSecurityGivebackStateMapper capitalSecurityGivebackStateMapper;
    
   @Override
   public CapitalSecurityGivebackState insertCapitalSecurityGivebackState(CapitalSecurityGivebackState capitalSecurityGivebackState){
	   
        capitalSecurityGivebackStateMapper.insertSelective(capitalSecurityGivebackState);
	   return capitalSecurityGivebackState;
	   
   };
   @Override
   public CapitalSecurityGivebackState updateCapitalSecurityGivebackState(CapitalSecurityGivebackState capitalSecurityGivebackState){
	     capitalSecurityGivebackStateMapper.updateByPrimaryKeySelective(capitalSecurityGivebackState);
        return capitalSecurityGivebackState;
   };
   @Override
   public CapitalSecurityGivebackState deleteCapitalSecurityGivebackState(CapitalSecurityGivebackState capitalSecurityGivebackState){

	     capitalSecurityGivebackStateMapper.delete(capitalSecurityGivebackState);
        return capitalSecurityGivebackState;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public CapitalSecurityGivebackState saveOrUpdateCapitalSecurityGivebackState(CapitalSecurityGivebackState capitalSecurityGivebackState){
        if(capitalSecurityGivebackState.getId()==null)
        {
            capitalSecurityGivebackStateMapper.insertSelective(capitalSecurityGivebackState);
        }else{
            capitalSecurityGivebackStateMapper.updateByPrimaryKeySelective(capitalSecurityGivebackState);
        }
        return capitalSecurityGivebackState;
    };
}
